package com.lht.oauth2.jdbc.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lht.oauth2.jdbc.entity.SysUser;
import com.lht.oauth2.jdbc.mapper.SysUserMapper;
import com.lht.oauth2.jdbc.service.ISysUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Eric
 * @since 2019-05-13
 */
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService {

    @Autowired
    private SysUserMapper sysUserMapper;

    @Override
    public SysUser findByName(String username) {
        return sysUserMapper.selectOne(new QueryWrapper<SysUser>()
                    .eq("del_flag",1)
                    .eq("username",username));
    }
}
